home *** CD-ROM | disk | FTP | other *** search
-
- ;A game where you try not to hit the followers orbiting your mouse.
-
- int MouseRad
-
-
- ;The follower creature
-
- creature follower
- {
- int mx, my;
-
- mx = MouseX() ;MouseX and MouseY are built in pogo funcions
- my = MouseY()
- ;The system maintains the variables
- ;cx cy cdx cdy independently for each creature. They are set by the
- ;Parent during the Spawn call. Also maintains CID, Cage, and Cnew.
- ;Cnew is 1 only the 1st time you're evolved. Cage is # of times your
- ;evolved. CID is your handle. Kill(CID) is the Suicide call.
-
- ;Calculations to accelerate towards mouse
- if (cx > mx && cx > -10)
- {
- cdx = cdx-1
- }
- else
- {
- cdx = cdx + 1
- if cdx > 10
- cdx = 10
- }
- if (cy > my && cy > -10)
- {
- cdy = cdy-1
- }
- else
- {
- cdy = cdy + 1
- if cdy > 10
- cdy = 10
- }
- ;Move ourselves
- cx = cx + cdx
- cy = cy + cdy
-
- ;check for collision with mouse.
- if (Distance(mx,my,cx,cy) <= MouseRad + 2)
- {
- MouseRad = MouseRad+1
- SetColor(0, 255, 0, 0) ;flash background color red
- }
-
- ;Draw ourselves
- Circle(cx, cy, 2, cid+3)
- }
-
- creature mouser
- {
- int lclick;
- int llclick;
- int x,y
-
- ;Movement follows the mouse
- cx = MouseX()
- cy = MouseY()
- Disk(cx, cy, MouseRad, 15)
-
- llclick = lclick
- }
-
-
-
- int i
- int Ans
-
- ToGraphics() ;Switch to graphics mode
- PreSwap() ;Set up double buffering
-
- SetColor(15, 255, 100, 100) ;Make mouse's color (15) bright red
-
- Main:
- MouseRad = 8
-
- Spawn(mouser, 160, 100, 0, 0) ;Create the mouse creature
-
-
- i = 0
- loop
- {
- if (i&0x1f = 0) ;every now and then make a new follower
- Spawn(follower, 0, 0, 0, 0)
- i = i+1
- ClearScreen()
- Evolve()
- Swap() ;Swap drawing and display screens
- if (MouseRad > 200) ;check for blowout
- break
- SetColor(0, 0, 0, 0) ;Set background color to black in case flashed
- }
- KillAll();
- ToText()
- PrintS("AH HAA HAA HAA BLOWOUT!!!!")
- PrintS("Score ---- ")
- Print(i)
- Prints("Want to play again?")
- Ans = WaitKey()
- if ((Ans <> 'n') && (Ans <> 'N'))
- goto Main
-